package com.matt.system.service.impl;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.matt.system.dao.SystemMenuDao;
import com.matt.system.domain.TSysmenu;
import com.matt.system.service.SystemMenuService;

@Service
public class SystemMenuServiceImpl implements SystemMenuService {
	
	@Autowired
	private SystemMenuDao systemMenuDao;
	
	public List<TSysmenu> findAll(){
		return systemMenuDao.findAll();
	}

	@Override
	public void delete(String id) {
		TSysmenu t = systemMenuDao.findById(id);
		systemMenuDao.delete(t);
	}
	
	@Override
	public void update(TSysmenu sysmenu) {
		systemMenuDao.update(sysmenu);
	}
	
	@Override
	public void save(TSysmenu sysmenu) {
		systemMenuDao.save(sysmenu);
	}

	@Override
	public TSysmenu findById(String id) {
		// TODO Auto-generated method stub
		return systemMenuDao.findById(id);
	}

	@Override
	public TSysmenu findByParentId(String pid) {
		// TODO Auto-generated method stub
		return systemMenuDao.findByParentId(pid);
	}

	@Override
	public List<TSysmenu> findPageByCriteria(int pageNow, int pageSize,
			DetachedCriteria detachedCriteria) {
		// TODO Auto-generated method stub
		return systemMenuDao.findPageByCriteria(pageNow, pageSize, detachedCriteria);
	}

	@Override
	public long getCountByCriteria(DetachedCriteria detachedCriteria) {
		// TODO Auto-generated method stub
		return systemMenuDao.getCountByCriteria(detachedCriteria);
	}

	@Override
	public long getRows() {
		// TODO Auto-generated method stub
		return 0;
	}
}
